home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / invaders.lha / Blaine / Game.S next >
Encoding:
Text File  |  1980-01-04  |  38.9 KB  |  1,484 lines

  1. * Amiga 500 + 1 meg + External Drive
  2. * Devpac 2
  3.  
  4.     SECTION        Chipmemory,data_c    
  5.                             ;BY BLAINE EVANS
  6.                             ;1 ERITH WAY
  7.                             ;PONTYBODKIN
  8.                             ;NR MOLD
  9.                             ;CLWYD
  10.                             ;CH7 4TR
  11.                             ;TEL O352-771673
  12.         Opt    C-,D+
  13.  
  14. ***************************************************************************
  15. *        The Equates for Screen And Bobs               *
  16. ***************************************************************************
  17.  
  18. Height            Equ    256
  19. Width            Equ    40
  20. Depth            Equ    3
  21.  
  22. ScreenSize        Equ    Height*Width
  23.  
  24. MemoryRequired_1    Equ    ScreenSize*Depth
  25. MemoryRequired_2    Equ    ScreenSize*Depth
  26.  
  27. BobHeight        Equ    10
  28. BobWidth        Equ    2
  29. BobDepth        Equ    3
  30.  
  31. BobSize            Equ    BobHeight*(BobWidth*2)
  32.  
  33. HitsForBonus        Equ    15
  34. ****************************************************************************
  35.  
  36.         Include    ram:include/Hardware.i
  37.  
  38.     Move.l    4.w,a6            ;FIND EXEC BASE
  39.     Lea    Gfxlib(pc),a1        ;LOAD GRAPHICS LIBRARY IN A1
  40.     Moveq.l    #$00,d0            ;VERSION 0
  41.     Jsr    -552(a6)        ;OPEN LIBRARY
  42.     Move.l    d0,_Gfxbase        ;STORE D0 (GFX ADDRESS )
  43.     Beq    NoLib_Exit        ;ELSE EXIT
  44.  
  45.     Move.l    4.w,a6
  46.     Move.l    #MemoryRequired_1,d0    ; Amount of memory
  47.     Move.l    #$10002,d1        ; Clear+Chip memory
  48.     Jsr    -198(a6)        ; Allocate memory
  49.     Move.l    d0,DisplayScreen    ; Save area of memory
  50.     Beq    NoMem_Exit_2        ; Error-End
  51.  
  52.     Move.l    4.w,a6
  53.     Move.l    #MemoryRequired_2,d0    ; Amount of memory
  54.     Move.l    #$10002,d1        ; Clear+Chip memory
  55.     Jsr    -198(a6)        ; Allocate memory
  56.     Move.l    d0,WorkScreen        ; Save area of memory
  57.     Beq    NoMem_Exit_1        ; Error-End
  58.  
  59.     Move.l    4.w,a6
  60.     Jsr    -132(a6)        ; Forbid
  61.  
  62.     Move.l    DisplayScreen,d0    ; Start of Screen Memory
  63.     Bsr    Plane_Addresses        
  64.     Bsr    BuildAlienFlags
  65.     Bsr    BuildCoordinates
  66.     Bsr    Clear_Display
  67.     Bsr    Init
  68.     Move.l    #22565,Seed        * Random Number Seed
  69.  
  70.     Move.l    _Gfxbase,a0        ; LOAD ADDRESS OF GRAPHICS LIB IN A0
  71.     Move.l    50(a0),Oldcop        ; STORE CURRENT COPPER,ETC TO RETRIEVE LATER
  72. S
  73.     Move.l    #Newcop,50(a0)        ; POINT TO OUR COPPERLIST
  74. VGapIntro
  75.     Cmp.b    #0,Vhposr(a6)        ; VERTICAL BLANKING GAP 
  76.     Bne.s    VGapIntro
  77.     Bsr    BlitIntro
  78.     Btst    #$7,$bfe001        * Fire Button Pressed
  79.     Bne.s    VGapIntro
  80.     Move.w    #$0ff0,22(a4)        * Reset To Yellow
  81.  
  82. Wait                    ; WAIT LOOP
  83.     Cmp.b    #0,Vhposr(a6)        ; VERTICAL BLANKING GAP 
  84.     Bne.s    Wait            ;
  85. ;    Move.w    #$fff,$180(a6)        ; REMove TO MEASURE RASTER TIME
  86.  
  87.     Bsr    DoubleBuffer
  88.     Bsr    BlitClear
  89.     Bsr    AlienAnimation
  90.     Bsr    AlienMovement
  91.     Bsr    Joy_Test
  92.     Bsr    ShipMovement
  93.     Move.l    Vposr(a6),Seed        * Random Number Seed
  94.     Bsr    FireButton
  95.     Bsr    MissileMovement
  96.     Bsr    RandomizeFire
  97.     Bsr    FireAlienFire
  98.     Bsr    PosCalc
  99.     Bsr    Bonus
  100.     Bsr    BonusMovement
  101.     Bsr    AlienBonusCollision
  102.     Bsr    PlayerText
  103.     Bsr    UpDateScore
  104.     Bsr    EndLevel
  105.     Bsr    LastAlien
  106.  
  107. ;    Move.w    #$000,$180(a6)        ;REMove TO MEASURE RASTER TIME
  108.     Btst    #$6,$bfe001        ;QUIT LEFT MOUSE PRESSED
  109.     Bne.s    Wait
  110. Ended                    ;ELSE LOOP TO WAIT
  111.     Move.w    #%0000000000001111,Dmacon(a6)    * Kill Samples
  112.     Move.l    _Gfxbase,a0        ;LOAD GRAPHICS LIB ADDRESS IN A0
  113.     Move.l    Oldcop,50(a0)        ;RESTORE OLD COPPER TO RETURN TO EDITTER
  114.     Move.l    4.w,a6
  115.     Jsr    -138(a6)        ; Permit
  116. NoMem_Exit_2    
  117.     Move.l    4.w,a6
  118.     Move.l    DisplayScreen,a1    ; Address to release from
  119.     Move.l    #MemoryRequired_1,d0    ; Size to release
  120.     Jsr    -210(a6)        ; Free memory
  121. NoMem_Exit_1
  122.     Move.l    4.w,a6
  123.     Move.l    WorkScreen,a1        ; Address to release from
  124.     Move.l    #MemoryRequired_2,d0    ; Size to release
  125.     Jsr    -210(a6)        ; Free memory
  126. NoLib_Exit
  127.     Move.l    4.w,a6            ;FIND EXEC BASE
  128.     Move.l    _Gfxbase,a1        ;LOAD GRAPHICS BASE IN A1
  129.     Jsr    -414(a6)        ;CLOSE LIBRARY
  130. Exit
  131.     Rts                ;RETURN TO EDITER
  132.  
  133. Plane_Addresses    
  134.     Lea    Planes,a0        ; BitPlane Control Words
  135.     Moveq.l    #(Depth)-1,d1        ; Number of Planes-1
  136. PlaneLoop
  137.     Move.w    d0,6(a0)        ; Low Word of Bit-Plane 
  138.     Swap    d0                
  139.     Move.w    d0,2(a0)        ; High Word of Bit-Plane
  140.     Swap    d0
  141.     Add.l    #Width,d0        ; Interleaved Bit-Planes
  142.     Addq.l    #8,a0            ; Increment to Next Control Word
  143.     DBra    d1,PlaneLoop
  144.     Rts
  145. BuildAlienFlags
  146.     Move.l    #AlienHit,a0        * Base Address
  147.     Move.w    #(NumberBobs)-1,d0    * Number Of Long Words To Clear
  148. ReBuildFlags    
  149.     Move.w    #0,(a0)+        * Clear It
  150.     DBra    d0,ReBuildFlags
  151.     Rts
  152. BuildCoordinates
  153.     Move.l    #Xs1,a0
  154.     Move.l    #XCoord,a1
  155.     Move.w    #(NumberBobs)-1,d0    * Number Of Long Words 
  156. ReBuild2    
  157.     Move.w    (a1)+,(a0)+        
  158.     DBra    d0,ReBuild2
  159.     Move.l    #Ys1,a0
  160.     Move.l    #YCoord,a1
  161.     Move.w    #(NumberBobs)-1,d0    * Number Of Long Words 
  162. ReBuild2.1    
  163.     Move.w    (a1)+,d7
  164.     Add.w    YInc,d7
  165.     Move.w    d7,(a0)+        
  166.     DBra    d0,ReBuild2.1
  167.     Rts
  168.  
  169. Init
  170.     Lea    $dff000,a6
  171.     Move.w    #%1000011111000000,Dmacon(a6)    ; Give Blitter Priority
  172.     Move.w    #2,LastXVelocity
  173.     Move.w    #2,XVelocity
  174.     Move.w    #0,FireFlag
  175.     Move.l    #$3,Lives            * No of Lives to Loose
  176.     Move.w    #0,ShipX    
  177.     Move.b    #0,AlienHits
  178.     Move.w    #0,BonusFlag    
  179.     Move.w    #0,BonusHit
  180.     Move.b    #11,AlienSpeed
  181.     Move.b    #0,TotalAlienHits
  182.     Move.w    #0,YInc
  183.     Move.b    #0,TotalAlienHits    * Clear Flag
  184.     Move.l    #ShipExp1,DisplayShipExp
  185.     Move.l    #ShipExp2,WorkShipExp
  186.     Move.l    #Player1Score,a0
  187.     Move.l    #0,(a0)+            * Reset Score to 0
  188.     Move.l    #0,(a0)+
  189.  
  190.     move.l    DisplayScreen,d0
  191.     add.l    #60*Width*Depth,d0
  192.     move.l    d0,Text_Base        ; store address to start text
  193.     move.l    #Text,a0
  194.     move.l    a0,Text_Address        ; store current character
  195.     Rts
  196.  
  197. Clear_Display
  198.     Move.l    DisplayScreen,a0        ; Start of Screen1 memory
  199.     Move.l    #(MemoryRequired_1/4)-1,d0    ; Number of long words 
  200. Clear
  201.     Move.l    #$0,(a0)+            ; Transfer Data
  202.     DBra    d0,Clear            ; Loop till 0
  203.     Move.l    WorkScreen,a0            ; Start of Screen2 memory
  204.     Move.l    #(MemoryRequired_2/4)-1,d0    ; Number of long words 
  205. Clear_2
  206.     Move.l    #$0,(a0)+            ; Transfer Data
  207.     DBra    d0,Clear_2            ; Loop till 0
  208.     Rts
  209.  
  210.  
  211. PlayerOneScorer
  212.     Move.l    #Player1Score,a0        * Score Address
  213.     Moveq.l    #0,d0                * Clear Work Register
  214.     Move.b    4(a0),d0            * 10's
  215.     Divu    #10,d0                * Low Word=100's,High=10's
  216.     Add.b    d0,3(a0)            * Add to 100's
  217.     Swap    d0                * Low Word=10's
  218.     Move.b    d0,4(a0)            * Store 10's
  219.     Cmp.b    #10,4(a0)            * Above 10 Then
  220.     Beq.s    Hundreds            * Add 1 to Hundreds
  221.     Cmp.b    #10,3(a0)            * Above 10
  222.     Beq.s    Thousands
  223.     Cmp.b    #10,2(a0)            * Above 10
  224.     Beq.s    TenThousands
  225.     Cmp.b    #10,1(a0)            * Above 10
  226.     Beq.s    HundThousands
  227.     Cmp.b    #10,0(a0)            * Above 10
  228.     Beq.s    ResetScore
  229.     Rts
  230. Hundreds
  231.     Move.b    #0,4(a0)            * Clear Tens
  232.     Add.b    #1,3(a0)            * Add 1 to Hundreds
  233.     Rts
  234. Thousands
  235.     Move.b    #0,3(a0)            * Clear Hundreds
  236.     Add.b    #1,2(a0)            * Add 1 to Thousands
  237.     Rts
  238. TenThousands
  239.     Move.b    #0,2(a0)            * Clear Ten Thousands
  240.     Add.b    #1,1(a0)            * Add 1 to Hundred Thousands
  241.     Rts
  242. HundThousands
  243.     Move.b    #0,1(a0)            * Clear Hundred Thousands
  244.     Add.b    #1,0(a0)            * Add 1 to Thousand Thousands
  245.     Rts
  246. ResetScore
  247.     Move.b    #0,0(a0)            * Reset Score to 000000
  248.     Rts    
  249.  
  250. UpDateScore
  251.     Bsr    PlayerOneScorer
  252.     Move.l    WorkScreen,a1            * Address Of Screen Memory
  253.     Add.l    #(7*Width*Depth)+12,a1
  254.         Moveq    #6-1,d1                 * No of Chars Per Line-1
  255.     Moveq.l    #0,d0
  256.     Bsr    BlitScore
  257.     Move.l    #Lives,a0            * Number of Lives Remaining
  258.     Lea    3(a0),a0            * Unused Bytes
  259.     Move.l    WorkScreen,a1            * Address Of Screen Memory
  260.     Add.l    #(7*Width*Depth)+30,a1
  261.     Moveq.l    #0,d0
  262.         Moveq    #1-1,d1                 * No of Chars Per Line-1
  263.     Bsr    BlitScore
  264.     Rts
  265.  
  266. BlitScore
  267.     Move.w    #1-1,d3                * Number of Planes -1
  268. NoPlanes
  269. LP1      
  270.     Move.b    (a0)+,d0
  271.         Mulu.w    #8,d0                   * Find Font Gfx
  272.         Lea    Number_Font(pc),a2        * Font Gfx in a2
  273.         Add.l    d0,a2                     * Add Offset
  274.         Moveq    #7,d2                      * No of Lines High Font is
  275.         Move.l    a1,a3                * Save Address
  276. LP2      
  277.     Move.b    (a2)+,(a3)                * Font Gfx into Memory
  278.         Add.l    #Width*Depth,a3                * Add 1 Line Across
  279.         DBra    d2,LP2                    * Loop till 0
  280.         Addq.l    #1,a1                     * Increase Address by 1 Byte
  281.         DBra    d1,LP1                
  282.     Add.l    #Width,a1            * Next Interleaved Plane
  283.     DBra    d3,NoPlanes
  284.     Rts
  285.  
  286. PlayerText
  287.     Move.l    #PlayerScoreText1,a0
  288.     Move.l    WorkScreen,a1            * Address Of Screen Memory
  289.     Add.l    #(7*Width*Depth)+2,a1
  290.         Moveq    #9-1,d1                 * No of Chars Per Line-1
  291.     Bsr    TextWriter
  292.     Move.l    #PlayerLivesText1,a0
  293.     Move.l    WorkScreen,a1            * Address Of Screen Memory
  294.     Add.l    #(7*Width*Depth)+22,a1
  295.         Moveq    #6-1,d1                 * No of Chars Per Line-1
  296.     Bsr    TextWriter
  297.     Rts
  298.  
  299. TextWriter
  300.     Move.w    #1-1,d3                * Number of Planes -1
  301. NoPlanes1
  302.     Move.w    d1,d4                * No.Chars-1
  303. LP11      
  304.     Moveq.l    #0,d0
  305.     Move.b    (a0)+,d0
  306.     Sub.b    #32,d0
  307.         Mulu.w    #8,d0                   * Find Font Gfx
  308.         Lea    Font(pc),a2            * Font Gfx in a2
  309.         Add.l    d0,a2                     * Add Offset
  310.         Moveq    #7,d2                      * No of Lines High Font is
  311.         Move.l    a1,a3                * Save Address
  312. LP21      
  313.     Move.b    (a2)+,(a3)                * Font Gfx into Memory
  314.         Add.l    #Width*Depth,a3                * Add 1 Line Across
  315.         DBra    d2,LP21                    * Loop till 0
  316.         Addq.l    #1,a1                     * Increase Address by 1 Byte
  317.         DBra    d4,LP11                
  318.     Add.l    #Width,a1            * Next Interleaved Plane
  319.     DBra    d3,NoPlanes1
  320.     Rts
  321.  
  322. Joy_Test
  323.     Move.w    $DFF00c,d2        * ADDRESS OF STICK 2
  324.     Move.w    d2,d1            * COPY TO D1
  325.     Lsr.w    #1,d1            * LOGICAL SHIFT RIGHT
  326.     Eor.w    d2,d1            * EXCLUSIVE OR D2 WITH D1
  327.     Btst    #1,d2            * TEST BIT 1 OF D2 (RIGHT)
  328.     Beq    Try_Left        * IF NOT EquAL THEN TRY LEFT
  329.     Move.w    #2,ShipX        * Add 1 to X
  330.     Rts
  331. Try_Left
  332.     Btst    #9,d2            ;TEST BIT 9 (LEFT)
  333.     Beq    No_Move        
  334.     Move.w    #-2,ShipX        * Subtract 1 from X
  335.     Rts
  336. No_Move
  337.     Move.w    #0,ShipX
  338.     Rts                * Stationary No Move
  339. ShipBoundary
  340.     Cmp.w    #292,d0            * Farthest Right Position
  341.     Bhs.s    No_Right        * If There Then No Move
  342.     Cmp.w    #06,d0            * Farthest Left Position
  343.     Bls.s    No_Left            * If There Then No Move
  344.     Rts
  345. No_Right
  346.     Subq.w    #2,d0
  347.     Rts
  348. No_Left
  349.     Addq.w    #2,d0
  350.     Rts
  351.  
  352. ShipMovement
  353.     Move.l    ShipsX(pc),a3        * X Co-ordinates
  354.     Move.l    ShipsY(pc),a4        * Y Co-ordinates
  355.     Moveq.l    #0,d0            * Clear Work Register
  356.     Moveq.l    #0,d1            * Clear Work Register
  357.     Move.w    (a3),d0            * Find Co-odinates Location  
  358.     Move.w    (a4),d1            * in List
  359.     Bsr    ShipBoundary
  360.     Movem.l    d0-d7/a0-a6,-(sp)    * Save Registers
  361.     Add.w    ShipX,d0
  362.     Move.w    d0,(a3)            * Last X
  363.     Move.w    d1,(a4)            * Last Y
  364.     Move.l    #ShipMask,a0        * A
  365.     Move.l    #Ship,a1        * B
  366.     Bsr    Bob_draw
  367.     Bsr    OrBlit
  368.     Movem.l    (sp)+,d0-d7/a0-a6    * Restore Registers
  369.     Rts
  370.  
  371. FireButton    
  372.     Cmp.w    #0,FireFlag            * Is Missile in Motion
  373.     Bne    Return                * No,Then Skip FireButton
  374.     Btst    #$7,$bfe001            * Joystick Button
  375.     Beq.s    Fired
  376.     Rts
  377. Fired
  378.     Move.w    #1,FireFlag
  379.     Move.l    #FireSample,Aud2lch(a6)        * Tell system where sample data is
  380.     Move.w    #1932,Aud2len(a6)        * Length of sample in words
  381.     Move.w    #64,Aud2vol(a6)            * Full volume
  382.     Move.w    #$12c,Aud2per(a6)        * Frequency
  383.     Move.w    #%1000001000000100,Dmacon(a6)    * Channel 1 Only
  384.     Move.l    MissileX(pc),a1
  385.     Move.l    MissileY(pc),a2
  386.     Move.l    ShipsX(pc),a3
  387.     Move.l    ShipsY(pc),a4
  388.     Move.w    0(a3),0(a1)            * Ship X=Missile X
  389.     Move.w    0(a4),0(a2)            * Ship Y=Missile Y
  390.     Rts
  391.  
  392. MissileMovement
  393.     Cmp.w    #1,FireFlag        * Is Missile in Motion
  394.     Bne.s    Return            * No,Then Skip Movement
  395.     Move.l    MissileX(pc),a3
  396.     Move.l    MissileY(pc),a4
  397.     Moveq.l    #0,d0            * Clear Work Register
  398.     Moveq.l    #0,d1            * Clear Work Register
  399.     Subq.w    #8,0(a4)        * Missile Upwards
  400.     Move.w    (a3),d0            * Find Co-odinates Location  
  401.     Move.w    (a4),d1            * in List
  402.     Bsr    MissileBoundary
  403.     Move.l    #MissileMask,a0        * A
  404.     Move.l    #Missile,a1        * B
  405.     Bsr    Bob_draw
  406.     Bsr    OrBlit
  407. Return
  408.     Rts
  409.  
  410. MissileBoundary
  411.     Cmp.w    #10,0(a4)            * Top Of Screen
  412.     Bls.s    ResetMissile            * Yes,Reset Flag to
  413.     Cmp.w    #165,0(a4)            * Missile Sample Length
  414.     Bls.s    ResetVoice2            * Yes,Kill Sample
  415.     Rts                    * Allow Missile to be
  416. ResetMissile                    * Fired Again
  417.     Move.w    #%0000000000000100,Dmacon(a6)    * Kill Channel 2 
  418.     Move.w    #0,FireFlag
  419.     Rts
  420. ResetVoice2
  421.     Move.w    #%0000000000000100,Dmacon(a6)    * Kill Channel 2 
  422.     Rts
  423.  
  424. Bonus
  425.     Cmp.w    #0,BonusFlag
  426.     Bne.s    Return
  427.     Cmp.b    #HitsForBonus,AlienHits        * Number of Hits
  428.     Beq.s    BonusPath
  429.     Rts
  430. BonusPath
  431.     Move.w    #1,BonusFlag    
  432.     Move.l    BonusX(pc),a0
  433.     Move.l    BonusY(pc),a1
  434.     Move.w    #0,0(a0)            * X Start
  435.     Move.w    #17,0(a1)            * Y Start
  436.     Rts                    * Return
  437. BonusMovement
  438.     Cmp.w    #1,BonusFlag            * Is Bonus in Motion
  439.     Bne.s    Return                * No,Then Skip Movement
  440.     Cmp.w    #1,BonusHit
  441.     Beq    BonusExplosion
  442.     Move.l    BonusX(pc),a0
  443.     Move.l    BonusY(pc),a1
  444.     Moveq.l    #0,d0            * Clear Work Register
  445.     Moveq.l    #0,d1            * Clear Work Register
  446.     Cmp.w    #304,0(a0)        * Max Position Right
  447.     Bhs.s    ResetBonus        * Greater Than Reset
  448.     Addq.w    #2,0(a0)        * Alien Bonus Across
  449.     Move.w    (a0),d0            * X
  450.     Move.w    (a1),d1            * Y
  451.     Move.l    #BonusMask,a0        * A Blit Data
  452.     Move.l    #BonusAlien,a1        * B Blit Data
  453.     Bsr    Bob_draw
  454.     Bsr    OrBlit
  455.     Rts
  456.  
  457. ResetBonus
  458.     Move.w    #0,0(a0)            * Erase Bonus Alien X
  459.     Move.w    #0,0(a1)            * Erase Bonus Alien Y
  460.     Move.w    #0,BonusFlag            * Clear Flag
  461.     Move.b    #0,AlienHits            * Clear Flag
  462.     Rts
  463.  
  464. AlienBonusCollision    
  465.     Move.l    BonusX(pc),a1
  466.     Move.l    BonusY(pc),a2
  467.     Move.l    MissileX(pc),a3
  468.     Move.l    MissileY(pc),a4
  469.     Move.w    0(a1),d0            * BonusAlien X
  470.     Move.w    0(a2),d1            * BonusAlien Y
  471.     Move.w    0(a3),d2            * Missile X
  472.     Move.w    0(a4),d3            * Missile Y
  473.  
  474.     Add.w    #2,d1
  475.     Cmp.w    d3,d1                * d1=AlienY,d3=MissileY
  476.     Blo.s    MissedAlienBonus        * If Lower Than Its Missed
  477.  
  478.     Subq.w    #6,d1                * Pixel Perfect Detection
  479.     Cmp.w    d3,d1                * d1=AlienY,d3=MissileY
  480.     Bhi.s    MissedAlienBonus        * If Higher Than Its Missed
  481.  
  482.     Subq.w    #8,d0
  483.     Cmp.w    d2,d0                * d0=AlienX,d2=MissileX
  484.     Bhi.s    MissedAlienBonus        * If Lower Its Missed    
  485.  
  486.     Add.w    #16,d0                * Pixel Perfect Detection
  487.     Cmp.w    d2,d0                * d0=AlienX,d2=MissileX
  488.     Blo.s     MissedAlienBonus        * If Higher Its Missed
  489.  
  490.     Move.w    #0,0(a3)            * Erase Missile X
  491.     Move.w    #0,0(a4)            * Erase Missile Y
  492.     Move.w    #0,FireFlag            * Renable Fire
  493.     Lea    Player1Score,a0
  494.     Add.b    #1,3(a0)            * Add 1 to Hundreds
  495.     Move.w    #1,BonusHit
  496. MissedAlienBonus
  497.     Rts
  498.  
  499. BonusExplosion
  500.     Cmp.w    #1,BonusHit
  501.     Bne    Return
  502.     Move.l    #ExpSample,Sample        * Sample to Play
  503.     Move.w    #13748,SampleLength        * Length of Sample
  504.     Bsr    PlayShipExpSample        * Play Sample
  505.     Lea    AlienBonusColours,a0        * Alien Colour
  506.     Move.w    #$0ff0,6(a0)            * Change To Yellow
  507.     Move.l    BonusX(pc),a0
  508.     Move.l    BonusY(pc),a1
  509.     Add.b    #1,BonusExpAnim
  510.     Cmp.b    #6,BonusExpAnim
  511.     Bhs    BonusExplosion2
  512.     Move.w    (a0),d0            * X
  513.     Move.w    (a1),d1            * Y
  514.     Move.l    #ExplosionMask1,a0
  515.     Move.l    #Explosion1,a1        * New Graphics Data
  516.     Bsr    Bob_draw
  517.     Bsr    OrBlit
  518.     Rts
  519. BonusExplosion2
  520.     Cmp.b    #13,BonusExpAnim
  521.     Bhs    BonusExpReset
  522.     Move.w    (a0),d0            * X
  523.     Move.w    (a1),d1            * Y
  524.     Move.l    #ExplosionMask2,a0
  525.     Move.l    #Explosion2,a1        * New Graphics Data
  526.     Bsr    Bob_draw
  527.     Bsr    OrBlit
  528.     Rts
  529. BonusExpReset    
  530.     Lea    AlienBonusColours,a0        * Alien Colour
  531.     Move.w    #$0fff,6(a0)            * Back To White
  532.     Move.w    #0,BonusHit            * Clear Flag
  533.     Move.b    #0,BonusExpAnim            * Clear Flag
  534.     Move.w    #0,BonusFlag            * Clear Flag
  535.     Move.b    #0,AlienHits            * Clear Flag
  536.     Move.l    BonusX(pc),a0
  537.     Move.l    BonusY(pc),a1
  538.     Move.w    #0,0(a0)            * Erase Bonus Alien X
  539.     Move.w    #0,0(a1)            * Erase Bonus Alien Y
  540.     Move.w    #$1,Dmacon(a6)            * Kill Sample
  541.     Rts
  542.  
  543.  
  544. AlienAnimation
  545.     Add.b    #1,AnimDelayRow3
  546.     Add.b    #1,AnimDelayRow2
  547.     Add.b    #1,AnimDelayRow1
  548.     Moveq.l    #0,d5                * Clear d5
  549.     Move.b    AlienSpeed,d5            * Speed in Relation to Animation
  550.     Asl.w    #1,d5                * Multiply By 2
  551.     Cmp.b    AnimDelayRow3,d5        * Which Animation ?
  552.     Blt    AnimationResetRow3
  553.     Rts
  554. AnimationResetRow3
  555.     Move.b    #0,AnimDelayRow3
  556.     Move.b    #0,AnimDelayRow2
  557.     Move.b    #0,AnimDelayRow1
  558.     Rts
  559.  
  560. AlienData                    * Bob Data
  561.     Move.b    AlienSpeed,d5            * For Comparisions/Animation Speed 
  562.     Cmp.w    #((NumberBobs-22)*2)-1,d7    * Rows 4-5
  563.     Bls.s    NextRow
  564.     Move.b    #1,Points            * Value of Alien/10
  565.     Cmp.b    AnimDelayRow3,d5
  566.     Blt    Animation2.1
  567.     Move.l    #BobGraphics_1,AlienAnim
  568.     Move.l    #Mask_1,AlienMaskAnim
  569.     Rts
  570. Animation2.1
  571.     Move.l    #BobGraphics_2,AlienAnim
  572.     Move.l    #Mask_2,AlienMaskAnim
  573.     Rts
  574.  
  575. NextRow
  576.     Move.b    #3,Points            * Value of Alien/10
  577.     Cmp.w    #((NumberBobs-44)*2)-1,d7    * Row 3-2
  578.     Bls.s    NextRow2
  579.     Cmp.b    AnimDelayRow2,d5
  580.     Blt    Animation2.2
  581.     Move.l    #BobGraphics_3,AlienAnim
  582.     Move.l    #Mask_3,AlienMaskAnim
  583.     Rts
  584. Animation2.2
  585.      Move.l    #BobGraphics_4,AlienAnim
  586.     Move.l    #Mask_4,AlienMaskAnim
  587.     Rts
  588. NextRow2
  589.     Move.b    #5,Points            * Value of Alien/10
  590.     Cmp.b    AnimDelayRow1,d5
  591.     Blt    Animation2.3
  592.     Move.l    #BobGraphics_5,AlienAnim    * Row 1
  593.     Move.l    #Mask_5,AlienMaskAnim
  594.     Rts
  595. Animation2.3
  596.     Move.l    #BobGraphics_6,AlienAnim    * Row 1
  597.     Move.l    #Mask_6,AlienMaskAnim
  598.     Rts
  599.  
  600. DoubleBuffer
  601.     Move.l    WorkScreen(pc),a0        * a0 = Work Screen
  602.     Move.l    DisplayScreen(pc),WorkScreen    * Switch Screens
  603.     Move.l    a0,DisplayScreen        * Display Work Screen
  604.     Move.l    a0,d0                * Load Bit-Planes
  605.     Bsr    Plane_Addresses
  606.     Rts
  607.  
  608. Collision
  609.     Move.l    #AlienHit,a0        * Has Alien Already Been Hit
  610.     Move.w    (a0,d7),d6
  611.     And.w    #$0fff,d6        * Mask Out Collision Bits
  612.     Cmp.w    #$0000,d6
  613.     Bne    CollReturn        
  614.     Move.w    0(a2),d2
  615.     Move.w    d1,d4
  616.     Subq.w    #4,d4
  617.     Cmp.w    d2,d4            * d4=AlienY,d2=MissileY
  618.     Blo    CollReturn        * If Lower Than Its Missed
  619.  
  620.     Subq.w    #4,d4            * Pixel Perfect Detection
  621.     Cmp.w    d2,d4            * d4=AlienY,d2=MissileY
  622.     Bhi    CollReturn        * If Higher Than Its Missed
  623.  
  624.     Move.w    0(a1),d3
  625.     Move.w    d0,d4            * Save Alien 
  626.     Subq.w    #6,d4
  627.     Cmp.w    d3,d4            * d4=AlienX,d3=MissileX
  628.     Bhi.s    CollReturn        * If Lower Its Missed    
  629.  
  630.     Add.w    #11,d4            * Pixel Perfect Detection
  631.     Cmp.w    d3,d4            * d4=AlienX,d3=MissileX
  632.     Blo.s     CollReturn        * If Higher Its Missed
  633.  
  634.     Move.l    #AlienHit,a0
  635.     Move.w    (a0,d7),d6
  636.     Or.w    #$0001,d6
  637.     Move.w    d6,(a0,d7)
  638.  
  639.     Move.w    #0,0(a1)        * Clear Missile X
  640.     Move.w    #0,0(a2)        * Clear Missile Y
  641.     Move.w    #0,FireFlag        * Ready to Fire Again
  642.     Lea    Player1Score,a0
  643.     Move.b    Points,d5            * Value of Alien
  644.     Add.b    d5,4(a0)            * Add Value of Alien to 100's
  645.     Add.b    #1,AlienHits
  646.     Add.b    #1,TotalAlienHits
  647.     Add.b    #1,SpeedHits            * For Alien Speed Increase
  648.     Move.l    #AlienSample,Aud1lch(a6)    * Tell system where sample data is
  649.     Move.w    #4536,Aud1len(a6)        * Length of sample in words
  650.     Move.w    #64,Aud1vol(a6)            * Full volume
  651.     Move.w    #$12c,Aud1per(a6)        * Frequency
  652.     Move.w    #%1000001000000010,Dmacon(a6)    * Channel 1 Only
  653.     Rts
  654. CollReturn
  655.     Rts
  656.  
  657. PosCalc
  658.     Move.w    #(NumberBobs-1)*2,d7    * Number of Bobs-1 * Word Width
  659.     Move.l    Xa(pc),a3        * X Co-ordinates
  660.     Move.l    Ya(pc),a4        * Y Co-ordinates
  661. Pos_bobs
  662.     Moveq.l    #0,d0            * Clear Work Register
  663.     Moveq.l    #0,d1            * Clear Work Register
  664.     Move.l    MissileX(pc),a1
  665.     Move.l    MissileY(pc),a2
  666.     Move.w    (a3,d7),d0        * Find Co-odinates Location  
  667.     Move.w    (a4,d7),d1        * in List
  668.     Cmp.w    #198,d1            * Same Y As Base Ship
  669.     Bhs    GameOver
  670.     Movem.l    d0-d7/a0-a6,-(sp)    * Save Registers
  671.     Bsr    AlienData
  672.     Bsr    Collision
  673.     Add.w    XVelocity,d0        * X
  674.     Add.w    YVelocity,d1        * Y
  675.     Bsr    BeenHit
  676.     Move.w    d0,(a3,d7)        * Last X
  677.     Move.w    d1,(a4,d7)        * Last Y
  678.     Move.l    AlienMask,a0                * A
  679.     Move.l    Alien,a1                * B
  680.     Bsr    Bob_draw
  681.     Bsr    OrBlit
  682.     Movem.l    (sp)+,d0-d7/a0-a6    * Restore Registers
  683.     Subq.w    #2,d7            * Next Bob( -1 Word )
  684.     Bpl.s    Pos_bobs
  685.     Rts
  686.  
  687. BeenHit
  688.     Move.l    #AlienHit,a0
  689.     Move.w    (a0,d7),d6
  690.     Move.w    d6,d5            * Save Info
  691.     And.w    #$0fff,d6        * Mask Out Collision Bits
  692.     Cmp.w    #$0000,d6
  693.     Beq    NotHit            * Skip Animation Routine
  694.     Add.w    #$0001,d5
  695.     Add.w    #$0001,d6
  696.     Move.w    d5,(a0,d7)
  697.     Cmp.w    #$0006,d6
  698.     Bhs    ExpOne
  699.     Move.l    #Explosion1,Alien        * Various Animations
  700.     Move.l    #ExplosionMask1,AlienMask    * For Explosion
  701.     Rts
  702. ExpOne
  703.     Cmp.w    #$000a,d6
  704.     Bhs    ExpEnd
  705.     Move.l    #Explosion2,Alien
  706.     Move.l    #ExplosionMask2,AlienMask
  707.     Move.w    #$2,Dmacon(a6)            * Kill Sample(Voice 1)
  708.     Rts    
  709. ExpEnd
  710.     And.w    #$f00a,(a0,d7)            * Animate No More
  711.     Move.l    #Destroyed,Alien
  712.     Move.l    #Destroyed,AlienMask
  713.     Move.w    #0,d0                * Clear X
  714.     Move.w    #0,d1                * Clear Y
  715.     Rts
  716. NotHit
  717.     Move.l    AlienAnim,Alien
  718.     Move.l    AlienMaskAnim,AlienMask
  719.     Rts
  720. ************************* Alien Fire Routine ***********************
  721. FireAlienFire
  722.     Move.w    #(NumberBobs-1)*2,d5        * Number of Bobs
  723. FFire    
  724.     Bsr    Alien_Fire
  725.     Sub.w    #2,d5                * Next Bob
  726.     Cmp.w    #((NumberBobs-1)-10)*2,d5    
  727.     Bge.s    FFire
  728.     Rts
  729.  
  730. Alien_Fire
  731.     Move.l    Xlien(pc),a3        * X Co-ordinates
  732.     Move.l    Ylien(pc),a4        * Y Co-ordinates
  733.     Move.l    #AlienHit,a0
  734.     Move.w    d5,d7            * Bottom Bob Number
  735. InMotion
  736.     Move.w    (a0,d7),d6
  737.     And.w    #$f000,d6        * Mask out Unwanted Bits
  738.     Cmp.w    #$3000,d6        * Already in Motion
  739.     Beq.s    AlreadyMoving
  740.  
  741.     Move.w    (a0,d7),d6
  742.     And.w    #$f000,d6        * Mask out Unwanted Bits
  743.     Cmp.w    #$1000,d6        * Already in Motion
  744.     Beq.s    AFire
  745. Fire_Bobs
  746.     Move.w    (a0,d7),d6
  747.     And.w    #$000f,d6
  748.     Cmp.w    #$000a,d6        * Already Destroyed
  749.     Bne    Return            * So Alien Can't Fire
  750. NextColumn
  751.     Sub.w    #11*2,d7        * Next Bob( -1 Word )
  752.     Bpl.s    InMotion        * Try Next Bob
  753.     Rts
  754. AFire
  755.     Moveq.l    #0,d0            * Clear Work Register
  756.     Moveq.l    #0,d1            * Clear Work Register
  757.     Move.l    Xa(pc),a1        * X Co-ordinates
  758.     Move.l    Ya(pc),a2        * Y Co-ordinates
  759.     Move.w    (a1,d7),d0        * Find Co-odinates Location  
  760.     Move.w    (a2,d7),d1        * in List
  761.     Add.w    #(BobHeight)-2,d1    * Start at Bottom of Alien
  762.     Move.w    d0,(a3,d7)        * Last X
  763.     Move.w    d1,(a4,d7)        * Last Y
  764.  
  765.     Or.w    #$2000,(a0,d7)        * Found X,Y Start Position/Set Flag
  766.  
  767.     Move.l    #FireMask,a0        * A
  768.     Move.l    #AlienFire,a1        * B
  769.     Bsr    Bob_draw
  770.     Bsr    OrBlit
  771.     Rts
  772. AlreadyMoving
  773.     Moveq.l    #0,d0            * Clear Work Register
  774.     Moveq.l    #0,d1            * Clear Work Register
  775.     Move.w    (a3,d7),d0        * Find Co-odinates Location  
  776.     Move.w    (a4,d7),d1        * in List
  777.     Bsr    FireCollison
  778.     Add.w    #7,d1            * Y Movement Down Screen
  779.     Move.w    d0,(a3,d7)        * Last X
  780.     Move.w    d1,(a4,d7)        * Last Y
  781.     Move.l    #FireMask,a0        * A
  782.     Move.l    #AlienFire,a1        * B
  783.     Bsr    Bob_draw
  784.     Bsr    OrBlit
  785.     Rts
  786.  
  787. RandomizeFire
  788.     Moveq.l    #56,d0            * d0=Max Value+1
  789.     Bsr    Rnd            * Get Random Value
  790.     Move.l    d0,d7            * Save Value
  791.     Asl.w    #1,d7            * *2
  792.     Move.l    #AlienHit,a0        * Flag Address
  793.     Move.w    (a0,d7),d6
  794.     And.w    #$000f,d6
  795.     Cmp.w    #$000a,d6        * Already Destroyed
  796.     Beq    Return            * So Alien Can't Fire
  797.     Or.w    #$1000,(a0,d7)        * Found X,Y Start Position/Set Flag
  798.     Rts
  799.  
  800. Rnd    
  801.     Move.l    d0,d1            * Make a copy
  802.     Subq.l    #1,d1            * Adjust
  803. RandomLoop    
  804.     Bsr    RandomValue        * Get random value
  805.     And.l    #$ffff,d0         * Mask off high bits
  806.     Mulu    d1,d0            * *Num
  807.     Divu    #$ffff,d0        * /Range of random val
  808.     And.l    #$ffff,d0        * Mask off remainder
  809.     Cmp.l    LastRND,d0        * Same value?
  810.     Beq.s    RandomLoop        * If so get another
  811.     Move.l    d0,LastRND        * Save this value
  812.     Addq.l    #1,d0            * Correct
  813.     Rts                * And Return it
  814.     
  815. RandomValue    
  816.     Move.l    d1,-(sp)
  817.     Move.l    a0,-(sp)
  818.     Move.l    Seed,d0            * Get Seed
  819.     Rol.l    d0,d0            * Scramble Bits
  820.     Move.l    d0,d1
  821.     And.l    #$7fffe,d1        * Create Ptr into CHIP
  822.     Move.l    d1,a0
  823.     Add.l    (a0),d0            * Add Onto Scrambled Bits
  824.     Add.l    d0,Seed            * Save Value
  825.  
  826.     Move.l    (sp)+,a0
  827.     Move.l    (sp)+,d1
  828.     Rts
  829.  
  830.  
  831. FireCollison
  832.     Bsr    ShipCollision
  833.     Cmp.w    #204,d1
  834.     Bhs.s    HitBottomScreen
  835.     Rts
  836. HitBottomScreen
  837.     Move.l    #AlienHit,a0
  838.     And.w    #$0fff,(a0,d7)        * Reset Flag to 0
  839.     Move.l    #Destroyed,a0        * A
  840.     Move.l    #Destroyed,a1        * B
  841.     Rts
  842.  
  843. ShipCollision
  844.     Move.l    ShipsX(pc),a1
  845.     Move.l    ShipsY(pc),a2
  846.     Move.w    0(a2),d2
  847.     Add.w    #16,d2
  848.     Cmp.w    d1,d2            * d1=AlienMissileY,d2=ShipY
  849.     Blo    MissedShip        * If Lower Than Its Missed
  850.  
  851.     Sub.w    #14,d2            * Pixel Perfect Detection
  852.     Cmp.w    d1,d2            * d1=AlienMissileY,d2=ShipY
  853.     Bhi    MissedShip        * If Higher Than Its Missed
  854.  
  855.     Move.w    0(a1),d3
  856.     Subq.w    #6,d3
  857.     Cmp.w    d0,d3            * d0=AlienMissileX,d3=ShipX
  858.     Bhi    MissedShip        * If Lower Its Missed    
  859.  
  860.     Add.w    #14,d3            * Pixel Perfect Detection
  861.     Cmp.w    d0,d3            * d4=AlienMissileX,d3=ShipX
  862.     Blo.s     MissedShip        * If Higher Its Missed
  863.     Move.w    #%0000000000000110,Dmacon(a6)    * Kill Channel 1,2 
  864.     
  865.     Move.l    #ExpSample,Sample        * Sample to Play
  866.     Move.w    #13748,SampleLength        * Length of Sample
  867.     Bsr    PlayShipExpSample        * Play Sample
  868.     ;Move.w    #$1,Dmacon(a6)            * Kill Sample
  869.     Bsr    AnimateShipExp
  870.     Bsr    HitBottomScreen            * Erase Alien Fire
  871.     Move.l    BonusX(pc),a0
  872.     Move.l    BonusY(pc),a1
  873.     Move.w    #0,0(a0)
  874.     Move.w    #0,0(a1)
  875.     Move.w    #0,FireFlag
  876.     Move.w    #0,BonusFlag            * Clear Flag
  877.     Move.b    #0,AlienHits            * Clear Flag
  878.  
  879.     Sub.l    #1,Lives            * Loose 1 Life
  880.     Cmp.l    #0,Lives            * Does Lives=0
  881.     Beq.s    GameOver            * Game Over
  882.     Move.w    #%0000000000000111,Dmacon(a6)    * Kill Channels 0,1,2 
  883.     Rts
  884. MissedShip
  885.     Rts                    * Missed
  886. GameOver                    * Game Over Routine
  887.     Move.w    #%0000000000000111,Dmacon(a6)    * Kill Channel 0,1,2
  888.     Movem.l    d0-d7/a0-a6,-(sp)        * Save Registers
  889.     Move.l    #GameOverText,a0
  890.     Move.l    DisplayScreen,a1        * Address Of Screen Memory
  891.     Add.l    #(110*Width*Depth)+13,a1
  892.         Moveq    #9-1,d1                 * No of Chars Per Line-1
  893.     Bsr    TextWriter
  894.     Movem.l    (sp)+,d0-d7/a0-a6        * Restore Registers
  895.     Bsr    BuildAlienFlags
  896.     Move.w    #0,YInc
  897.     Bsr    BuildCoordinates
  898.     Move.b    #0,TotalAlienHits        * Clear Flag
  899.     Move.w    #0,Speed            * Reset Speeds
  900.     Move.w    #2,XVelocity            
  901.     Move.w    #2,LastXVelocity
  902.     Move.b    #11,AlienSpeed            * Reset Speed To Slow
  903.     Move.b    #0,SpeedHits            * Clear Flag
  904.     Move.l    #$3,Lives            * Reset Lives to 3
  905.     Move.l    #Player1Score,a0
  906.     Move.l    #0,(a0)+            * Reset Score to 0
  907.     Move.l    #0,(a0)+
  908. GameHold    
  909.     Btst    #$7,$bfe001            * JoyStick Fire To Play Again
  910.     Bne.s    GameHold
  911.     Btst    #$7,$bfe001            * Released To Restart
  912.     Beq.s    GameHold
  913.     Rts
  914.  
  915. PlayShipExpSample
  916.     Move.l    Sample,Aud0lch(a6)        * Tell system where sample data is
  917.     Move.w    SampleLength,Aud0len(a6)    * Length of sample in words
  918.     Move.w    #64,Aud0vol(a6)            * Full volume
  919.     Move.w    #$12c,Aud0per(a6)        * Frequency
  920.     Move.w    #%1000001000000001,Dmacon(a6)    * Channel 0 Only
  921.     Rts
  922. AnimateShipExp
  923.     Move.l    ShipsX(pc),a1
  924.     Move.l    ShipsY(pc),a2
  925.     Move.w    0(a1),d0            * X
  926.     Move.w    0(a2),d1            * Y
  927.     Move.w    #5,d6
  928. ExpLoop
  929.     Move.l    #$ffffffff,d2
  930. Del    DBra    d2,Del
  931.     Movem.l    d0-d1/a1-a2,-(sp)        * Save Registers    
  932.     Move.l    WorkShipExp(pc),a0        * Switch Animations
  933.     Move.l    DisplayShipExp(pc),WorkShipExp    * Each Loop
  934.     Move.l    a0,DisplayShipExp
  935.     Move.l    DisplayScreen,d4        * Base address
  936.     Bsr    AD_Blit
  937.     Movem.l    (sp)+,d0-d1/a1-a2        * Restore Registers
  938.     DBra    d6,ExpLoop
  939.     Move.w    #06,0(a1)            * New Ship Position
  940.     Move.w    #202,0(a2)
  941.     Rts
  942.  
  943. ***********************************************************************
  944. ChangeSpeed
  945.     Cmp.b    #10,SpeedHits
  946.     Beq.s    IncreaseSpeed            * Increase Speed of Aliens
  947.     Rts
  948. IncreaseSpeed
  949.     Move.b    #0,SpeedHits            * Clear Flag
  950.     Sub.b    #2,AlienSpeed
  951.     Cmp.b    #5,AlienSpeed
  952.     Beq.s    SpeedUp1
  953.     Cmp.b    #3,AlienSpeed
  954.     Beq.s    SpeedUp2
  955.     Cmp.b    #1,AlienSpeed
  956.     Beq.s    SpeedUp3
  957.     Bsr    IncPlusSpeed
  958.     Rts
  959. SpeedUp1
  960.     Add.w    #01,Speed            * Increase Speed
  961.     Bsr    IncPlusSpeed
  962.     Rts
  963. SpeedUp2
  964.     Add.w    #01,Speed            * Increase Speed
  965.     Bsr    IncPlusSpeed
  966.     Rts
  967. SpeedUp3
  968.     Move.b    #3,AlienSpeed
  969.     Add.w    #02,Speed            * Increase Speed
  970.     Bsr    IncPlusSpeed
  971.     Rts
  972.  
  973. IncPlusSpeed
  974.     Move.w    Speed,d0
  975.     Move.w    LastXVelocity,d1
  976.     Bpl.s    IncMinusSpeed            * + or -
  977.     Neg.w    d0                * Left/Needs Speed -ve
  978.     Add.w    d0,LastXVelocity
  979.     Rts
  980. IncMinusSpeed
  981.     Add.w    d0,LastXVelocity        * Right/Needs Speed +ve
  982.     Rts
  983.  
  984. AlienMovement
  985.     Bsr    ChangeSpeed
  986.     Move.w    #0,XVelocity            * Clear Velocity
  987.     Move.w    #0,YVelocity            * Clear Velocity
  988.     Move.b    AlienSpeed,d0
  989.     Add.b    #1,Movement            * Only Move Alien Every
  990.     Cmp.b    Movement,d0            * So Many Frames
  991.     Bgt    Return
  992.     Move.w    LastXVelocity,XVelocity        * Restore Velocity
  993.     Move.b    #0,Movement            * Clear Flag
  994.     Move.l    #AlienHit,a0            * Hit/Exp Flags
  995.     Move.l    Xa(pc),a1            * X Co-ordinates
  996.     Move.l    Ya(pc),a2            * Y Co-ordinates
  997.     Move.w    XVelocity,d2
  998. TestPosition    
  999.     Bpl.s    GoingRight            * + or -(+=Right/-=Left)
  1000.     Move.w    #((NumberBobs-1)-10)*2,d7    * Bottom/Left Alien
  1001. TestDirLeft
  1002.     Move.w    (a0,d7),d3        
  1003.     And.w    #$000f,d3
  1004.     Cmp.w    #$000a,d3            * Already Destroyed
  1005.     Bne.s    TestGoingLeft            * So Try Next Alien
  1006.     Sub.w    #11*2,d7            * Next Bob Up
  1007.     Bpl.s    TestDirLeft            * Try Next Bob
  1008.     Add.w    #((NumberBobs-1)-10)*2,d7
  1009.     Add.w    #11*2,d7            * Next Bob Up
  1010.     Add.w    #2,d7                * And Left One
  1011.     Bpl.s    TestDirLeft
  1012.     ILLEGAL
  1013.     Move.w    #0,XVelocity            * No Aliens Remaining
  1014.     Move.w    #0,LastXVelocity
  1015.     Rts
  1016. TestGoingLeft
  1017.     Move.w    (a1,d7),d0            * X
  1018.     Cmp.w    #20,d0
  1019.     Bls    ChangeDirection
  1020.     Rts
  1021. GoingRight
  1022.     Move.w    #((NumberBobs-1))*2,d7        * Bottom/Right Alien
  1023. TestDirRight
  1024.     Move.w    (a0,d7),d3        
  1025.     And.w    #$000f,d3
  1026.     Cmp.w    #$000a,d3            * Already Destroyed
  1027.     Bne.s    TestGoingRight            * So Try Next Alien
  1028.     Sub.w    #11*2,d7            * Next Bob Up
  1029.     Bpl.s    TestDirRight            * Try Next Bob
  1030.     Add.w    #((NumberBobs-1)-10)*2,d7
  1031.     Add.w    #11*2,d7            * Next Bob Up
  1032.     Sub.w    #2,d7                * And Right One
  1033.     Bpl.s    TestDirRight
  1034.     ILLEGAL
  1035.     Move.w    #0,XVelocity            * No Aliens Remaining
  1036.     Move.w    #0,LastXVelocity
  1037.     Rts
  1038. TestGoingRight
  1039.     Move.w    (a1,d7),d0            * X
  1040.     Cmp.w    #280,d0
  1041.     Bhs    ChangeDirection
  1042.     Rts
  1043. ChangeDirection
  1044.     Neg.w    d2
  1045.     Move.w    d2,XVelocity        * Other Way
  1046.     Move.w    d2,LastXVelocity
  1047.     Move.w    #8,YVelocity        * Y Velocity Down
  1048.     Rts
  1049.  
  1050. EndLevel
  1051.     Cmp.b    #55,TotalAlienHits
  1052.     Beq    NewScreen
  1053.     Rts
  1054. NewScreen
  1055.     Move.w    #%0000000000001111,Dmacon(a6)    * Kill Channel 0,1,2,3
  1056.     Bsr    BuildAlienFlags
  1057.     Add.w    #8,YInc
  1058.     Bsr    BuildCoordinates
  1059.     Move.b    #0,TotalAlienHits    * Clear Flag
  1060.     Move.w    #0,Speed        * Reset Speeds
  1061.     Move.w    #2,XVelocity            
  1062.     Move.w    #2,LastXVelocity
  1063.     Move.b    #11,AlienSpeed        * Reset Speed To Slow
  1064.     Move.b    #0,SpeedHits        * Clear Flag
  1065.     Move.w    #$1,Dmacon(a6)        * Kill Sample
  1066.     Rts
  1067.  
  1068. LastAlien
  1069.     Cmp.b    #53-1,TotalAlienHits    * Last Aliens
  1070.     Blt.s    LastReturn
  1071.     Move.w    #((NumberBobs-1))*2,d7    * Number Alien
  1072.     Move.l    #AlienHit,a0        * Flag Address
  1073. LastA    
  1074.     Move.w    (a0,d7),d6
  1075.     And.w    #$000f,d6
  1076.     Cmp.w    #$000a,d6        * Already Destroyed
  1077.     Bne    SetAlienFlag        * So Alien Can't Fire
  1078.     Subq.w    #2,d7            * Next Bob( -1 Word )
  1079.     Bpl.s    LastA
  1080. SetAlienFlag
  1081.     Or.w    #$1000,(a0,d7)        * Found Last Alien-Set Flag
  1082. LastReturn
  1083.     Rts
  1084.  
  1085. Bob_draw
  1086.     Divu    #16,d0            * This gives no of words in lower
  1087.                     * Word and remainder is shift value
  1088.                     * In higher word
  1089.     Move.w    d0,d2
  1090.     Asl.w    #1,d2
  1091.     Mulu.w    #Width*Depth,d1        * Find screen address
  1092.     Add.w    d2,d1            * Add X to Y
  1093.     Move.l    WorkScreen,d4        * Base address
  1094.     Add.l    d1,d4            * Add to base address
  1095.     Move.l    d4,BobAddress        * New Address of Bob
  1096.     Asl.l    #8,d0            * Put Shift in Correct Place
  1097.     Asl.l    #4,d0            * Shift Left 12 Times
  1098.     And.l    #$f0000000,d0        * Clear Unwanted Bits
  1099.     Move.l    d0,Bltcon        * Save Result
  1100.     Rts
  1101.  
  1102. OrBlit
  1103.     Lea    $dff000,a6                * Custom base
  1104.     Move.l    Bltcon,d0
  1105.     Move.l    d0,d1                    * for Bltcon1
  1106.     Or.l    #$0fca0000,d0
  1107.     Move.l    BobAddress,a2                * C
  1108. Or_Bob                    * LOAD BLITTER WITH VALUES
  1109.     Bsr    Wfblit
  1110.     Move.l    a0,Bltapth(a6)                * Mask
  1111.     Move.l    a1,Bltbpth(a6)               * Source    
  1112.     Move.l    a2,Bltcpth(a6)                * Background
  1113.     Move.l    a2,Bltdpth(a6)                * Designation
  1114.     Move.w    #-2,Bltamod(a6)                * Mask Modula
  1115.     Move.w    #-2,Bltbmod(a6)                * Source Modula
  1116.     Move.w    #Width-(BobWidth*2),Bltcmod(a6)        * Designation Modula
  1117.     Move.w    #Width-(BobWidth*2),Bltdmod(a6)      * Designation Modula
  1118.     Move.l    d0,Bltcon0(a6)                * Bplcon0
  1119.     Move.l    d1,Bltcon1(a6)                * Bplcon1
  1120.     Move.w    #$ffff,Bltafwm(a6)            * First word mask
  1121.     Move.w    #$0000,Bltalwm(a6)              * Last word mask
  1122.     Move.w    #((BobHeight*BobDepth)*64)+(BobWidth),Bltsize(a6)  * Blitsize
  1123.     Rts
  1124. BlitClear
  1125.     Lea    $dff000,a6            * Custom base
  1126.     Bsr    Wfblit
  1127.     Move.l    WorkScreen,a0
  1128.     Move.l    a0,Bltapth(a6)            * Source and are
  1129.     Move.l    a0,Bltdpth(a6)            * Designation same
  1130.     Move.w    #0,Bltamod(a6)            * Source Modula
  1131.     Move.w    #0,Bltdmod(a6)             * Designation Modula
  1132.     Move.l    #$1000000,Bltcon0(a6)        * A Channel Only
  1133.     Move.l    #00,Bltcon1(a6)            * Bplcon1
  1134.     Move.w    #$ffff,Bltafwm(a6)        * First word mask
  1135.     Move.w    #$ffff,Bltalwm(a6)        * Last word mask
  1136.     Move.w    #((Height*Depth)*64)+(Width/2),Bltsize(a6)  * Blitsize
  1137.     Rts
  1138.  
  1139. Wfblit
  1140.     Btst    #14,Dmaconr(a6)            * Dmaconr
  1141.     Bne.s    Wfblit                * Test Blitter State
  1142.     Rts    
  1143.  
  1144. AD_Blit                    * LOAD BLITTER WITH VALUES
  1145.     Divu    #16,d0            * This gives no of words in lower
  1146.                     * Word and remainder is shift value
  1147.                     * In higher word
  1148.     Move.w    d0,d2
  1149.     Asl.w    #1,d2
  1150.     Mulu.w    #Width*Depth,d1        * Find screen address
  1151.     Add.w    d2,d1            * Add X to Y
  1152.     Add.l    d1,d4            * Add to base address
  1153.     Move.l    d4,BobAddress        * New Address of Bob
  1154.     Asl.l    #8,d0            * Put Shift in Correct Place
  1155.     Asl.l    #4,d0            * Shift Left 12 Times
  1156.     And.l    #$f0000000,d0        * Clear Unwanted Bits
  1157.     Move.l    d0,d1                    * for Bltcon1
  1158.     Or.l    #$09f00000,d0                * A-D Blit
  1159.     Move.l    BobAddress,a2                * D
  1160. ADBlit
  1161.     Bsr    Wfblit
  1162.     Move.l    a0,Bltapth(a6)                * Mask
  1163.     Move.l    a2,Bltdpth(a6)                * Designation
  1164.     Move.w    #-2,Bltamod(a6)                * Source Modula
  1165.     Move.w    #Width-(BobWidth*2),Bltdmod(a6)     * Designation Modula
  1166.     Move.l    d0,Bltcon0(a6)                * Bplcon0
  1167.     Move.l    d1,Bltcon1(a6)                * Bplcon1
  1168.     Move.w    #$ffff,Bltafwm(a6)            * First word mask
  1169.     Move.w    #$0000,Bltalwm(a6)              * Last word mask
  1170.     Move.w    #((BobHeight*BobDepth)*64)+(BobWidth),Bltsize(a6)  * Blitsize
  1171.     Rts
  1172.  
  1173. BlitIntro
  1174.     Move.l    #$fff,d0            * Delay Loop
  1175. IDel    DBra    d0,IDel
  1176.     Move.l    Text_Base,a1            * Address in a1
  1177.         Moveq    #1-1,d1                 * No of chars per line-1
  1178. Intro1      
  1179.     Moveq    #0,d0                * Clear d0
  1180.     Move.l    Text_Address,a0            * Text chars in a0
  1181.            Move.b    (a0),d0                * Next char
  1182.     Cmp.b    #$ee,d0                * $ee=add 8 lines*40 words
  1183.     Bne.s    Cont                * To address
  1184.     Add.l    #(8*Width*Depth)-Width,a1    * a1= address
  1185.     Add.w    #1,a0
  1186.     Move.b    (a0),d0                * Move next char
  1187.     Cmp.b    #$ff,d0                * $ff= end marker
  1188.     Beq    EndIntro    
  1189. Cont    
  1190.         Sub.b    #32,d0                     * Take off offset
  1191.         Mulu.w    #8,d0                   * To find font gfx
  1192.         Lea    Font(pc),a2            * Font gfx in a2
  1193.         Add.l    d0,a2                     * Add offset
  1194.         Moveq    #8-1,d2                     * No of lines high font is
  1195.         Move.l    a1,a3                * a3 now =adress
  1196. Intro2
  1197.     Move.b    (a2)+,d4            * a2=font
  1198.     Or.b    d4,(a3)                * Or font with background
  1199.         Add.l    #Width*Depth,a3                * Add 1 line across
  1200.            DBra    d2,Intro2                * Loop till 0
  1201.         DBra    d1,Intro1                    
  1202.     Add.w    #1,a0
  1203.     Move.l    a0,Text_Address            * Store value
  1204.         Addq.l    #1,a1                     * Increase address by 1 byte
  1205.     Move.l    a1,Text_Base            * Add 1 byte to address
  1206.     Rts
  1207. EndIntro
  1208.     Lea    AlienBonusColours,a4        * Colour Address In CopperList
  1209.     Add.b    #1,Flash
  1210.     Cmp.b    #15,Flash
  1211.     Bgt.s    ChangeFlash
  1212.     Move.w    #$0fff,22(a4)            * Change To White
  1213.     Rts
  1214. ChangeFlash
  1215.     Cmp.b    #30,Flash
  1216.     Bgt.s    FlashReset
  1217.     Move.w    #$0000,22(a4)            * Change To Black
  1218.     Rts
  1219. FlashReset
  1220.     Move.b    #0,Flash
  1221.     Rts
  1222.  
  1223. Gfxlib    Dc.b    "graphics.library",0    
  1224.     Even
  1225. _Gfxbase    Dc.l    0            ;LONG WORD TO STORE GFX ADDRESS
  1226. Oldcop        Dc.l    0            ;OLD COPPERLIST ADDRESS
  1227. DisplayScreen    Dc.l    0
  1228. WorkScreen    Dc.l    0
  1229. ScreenPointer    Dc.l    0
  1230. BobAddress    Dc.l    0
  1231. Bltcon        Dc.l    0
  1232. Sample        Dc.l    0
  1233. Alien        Dc.l    0
  1234. AlienMask    Dc.l    0
  1235. AlienAnim    Dc.l    0
  1236. AlienMaskAnim    Dc.l    0
  1237. ShipAnim    Dc.l    0
  1238. Seed        Dc.l    0            * For Random Generator
  1239. LastRND        Dc.l    0            * To stop repeats
  1240. Player1Score    Dc.l    0
  1241.         Dc.l    0
  1242. Player2Score    Dc.l    0
  1243.         Dc.l    0
  1244. YInc        Dc.l    0
  1245. DisplayShipExp    Dc.l    0
  1246. WorkShipExp    Dc.l    0
  1247. Lives        Dc.l    0
  1248. Text_Address    Dc.l    0
  1249. Text_Base    Dc.l    0
  1250. SampleLength    Dc.w    0
  1251. XVelocity    Dc.w    0
  1252. YVelocity    Dc.w    0
  1253. Speed        Dc.w    0
  1254. FireFlag    Dc.w    0
  1255. BonusFlag    Dc.w    0
  1256. BonusHit    Dc.w    0
  1257. LastXVelocity    Dc.w    0
  1258. ShipX        Dc.w    0
  1259. Points        Dc.b    0
  1260. Movement    Dc.b    0
  1261. AnimDelayRow1    Dc.b    0
  1262. AnimDelayRow2    Dc.b    0
  1263. AnimDelayRow3    Dc.b    0
  1264. ShipKillAnim    Dc.b    0
  1265. AlienHits    Dc.b    0
  1266. AlienSpeed    Dc.b    0
  1267. SpeedHits    Dc.b    0
  1268. BonusExpAnim    Dc.b    0
  1269. TotalAlienHits    Dc.b    0
  1270. Flash        Dc.b    0
  1271.     Even
  1272.  
  1273. XCoord
  1274.     Dc.w    30,46,62,78,94,110,126,142,158,174,190
  1275.     Dc.w    30,46,62,78,94,110,126,142,158,174,190
  1276.     Dc.w    30,46,62,78,94,110,126,142,158,174,190
  1277.     Dc.w    30,46,62,78,94,110,126,142,158,174,190
  1278.     Dc.w    30,46,62,78,94,110,126,142,158,174,190
  1279. YCoord
  1280.     Dc.w     30,30,30,30,30,30,30,30,30,30,30
  1281.     Dc.w     46,46,46,46,46,46,46,46,46,46,46
  1282.     Dc.w     62,62,62,62,62,62,62,62,62,62,62
  1283.     Dc.w     78,78,78,78,78,78,78,78,78,78,78
  1284.     Dc.w     94,94,94,94,94,94,94,94,94,94,94
  1285.  
  1286. NumberBobs    Equ    (*-YCoord)/2
  1287.     Even
  1288. ShipsX        Dc.l    Sx
  1289. ShipsY        Dc.l    Sy
  1290.  
  1291. Sx        Dc.w    06
  1292. Sy        Dc.w    202
  1293.  
  1294. MissileX    Dc.l    Mx
  1295. MissileY    Dc.l    My
  1296.  
  1297. Mx        Dc.w    0
  1298. My        Dc.w    0
  1299.  
  1300. BonusX        Dc.l    Bx
  1301. BonusY        Dc.l    By
  1302.  
  1303. Bx        Dc.w    0
  1304. By        Dc.w    0
  1305.  
  1306. Xa        Dc.l Xs1
  1307. Ya        Dc.l Ys1
  1308.  
  1309. Xs1        Dcb.w    NumberBobs,0
  1310. Ys1        Dcb.w    NumberBobs,0
  1311.  
  1312. Xlien        Dc.l Xl
  1313. Ylien        Dc.l Yl
  1314.  
  1315. Xl        Dcb.w    NumberBobs,0
  1316. Yl        Dcb.w    NumberBobs,0
  1317.  
  1318. AlienHit    Dcb.w    NumberBobs,0
  1319.  
  1320. Newcop
  1321.     Dc.w    BplCon0,%0011001000000000
  1322.     Dc.w    BplCon1,$0000            ; SCROLL VALUE
  1323.     Dc.w    BplCon2,%0000000001110111    ; PRIORITIES
  1324.     Dc.w    Bpl1Mod,Width*(Depth-1)        ; Modula1
  1325.     Dc.w    Bpl2Mod,Width*(Depth-1)        ; Modula2
  1326.     Dc.w    DdfStrt,$0038
  1327.     Dc.w    DdfStop,$00d0        
  1328.     Dc.w    DiwStrt,$2c81
  1329.     Dc.w    DiwStop,$2cc1        
  1330.                         
  1331. Planes
  1332.     Dc.w    Bpl1pth
  1333.     Dc.w    $0000,Bpl1ptl
  1334.     Dc.w    $0000,Bpl2pth
  1335.     Dc.w    $0000,Bpl2ptl
  1336.     Dc.w    $0000,Bpl3pth
  1337.     Dc.w    $0000,Bpl3ptl
  1338.     Dc.w    $0000,Bpl4pth
  1339.     Dc.w    $0000,Bpl4ptl
  1340.     Dc.w    $0000,Bpl5pth
  1341.     Dc.w    $0000,Bpl5ptl
  1342.     Dc.w    $0000,Bpl6pth
  1343.     Dc.w    $0000,Bpl6ptl
  1344.     Dc.w    $0000
  1345.  
  1346. Sprites                        ;SPRITES
  1347.     Dc.w    Spr0pth
  1348.     Dc.w    $0000,Spr0ptl
  1349.     Dc.w    $0000,Spr1pth
  1350.     Dc.w    $0000,Spr1ptl
  1351.     Dc.w    $0000,Spr2pth
  1352.     Dc.w    $0000,Spr2ptl
  1353.     Dc.w    $0000,Spr3pth
  1354.     Dc.w    $0000,Spr3ptl
  1355.     Dc.w    $0000,Spr4pth
  1356.     Dc.w    $0000,Spr4ptl
  1357.     Dc.w    $0000,Spr5pth
  1358.     Dc.w    $0000,Spr5ptl
  1359.     Dc.w    $0000,Spr6pth
  1360.     Dc.w    $0000,Spr6ptl
  1361.     Dc.w    $0000,Spr7pth
  1362.     Dc.w    $0000,Spr7ptl
  1363.     Dc.w    $0000
  1364.  
  1365. Colors    Dc.w    Color00,$0000,Color01,$00f0
  1366.     Dc.w    Color02,$0d10,Color03,$0f70
  1367.     Dc.w    Color04,$00ff,Color05,$00f0
  1368.     Dc.w    Color06,$0f0f,Color07,$0f82
  1369.  
  1370.     Dc.w    Color08,$0000,Color09,$0283
  1371.     Dc.w    Color10,$08f4,Color11,$0095
  1372.     Dc.w    Color12,$0243,Color13,$00ff
  1373.     Dc.w    Color14,$0ff0,Color15,$0f0f
  1374.  
  1375.     Dc.w    Color16,$0000,Color17,$0fff
  1376.     Dc.w    Color18,$0d00,Color19,$0F70
  1377.     Dc.w    Color20,$0000,Color21,$0f0f
  1378.     Dc.w    Color22,$0F00,Color23,$0d00
  1379.     Dc.w    Color24,$004f,Color25,$008f
  1380.     Dc.w    Color26,$00ff,Color27,$00f0
  1381.     Dc.w    Color28,$0283,Color29,$0ff0
  1382.     Dc.w    Color30,$0456,Color31,$0f00
  1383. AlienBonusColours
  1384.     Dc.w    $3b01,$fffe            * Change Colours0 + 1
  1385.     Dc.w    Color01,$0fff
  1386.     Dc.w    $4501,$fffe            * Change Colours0 + 1
  1387.     Dc.w    Color01,$0ff0
  1388.     Dc.w    $c001,$fffe            * Change Colours0 + 1
  1389.     Dc.w    Color01,$0ff0
  1390.     
  1391.     Dc.w    $ff01,$fffe,Color00,$0fff
  1392.     Dc.w    $ffdf,$fffe            * Pal Enable
  1393.     Dc.w    $0001,$fffe,Color00,$0fff,Color01,$0fff,Color02,$0fff,Color03,$0fff
  1394.     Dc.w    $0101,$fffe,Color00,$0eee,Color01,$0eee,Color02,$0eee,Color03,$0eee
  1395.     Dc.w    $0201,$fffe,Color00,$0ddd,Color01,$0ddd,Color02,$0ddd,Color03,$0ddd
  1396.     Dc.w    $0301,$fffe,Color00,$0ccc,Color01,$0ccc,Color02,$0ccc,Color03,$0ccc
  1397.     Dc.w    $0401,$fffe,Color00,$0bbb,Color01,$0bbb,Color02,$0bbb,Color03,$0bbb
  1398.     Dc.w    $0501,$fffe,Color00,$0aaa,Color01,$0aaa,Color02,$0aaa,Color03,$0aaa
  1399.     Dc.w    $0601,$fffe,Color00,$0999,Color01,$0999,Color02,$0999,Color03,$0999
  1400.     Dc.w    $0701,$fffe,Color00,$0888,Color01,$0888,Color02,$0888,Color03,$0888
  1401.     Dc.w    $0801,$fffe,Color00,$0777,Color01,$0777,Color02,$0777,Color03,$0777
  1402.     Dc.w    $0901,$fffe,Color00,$0666,Color01,$0666,Color02,$0666,Color03,$0666
  1403.     Dc.w    $0a01,$fffe,Color00,$0555,Color01,$0555,Color02,$0555,Color03,$0555
  1404.     Dc.w    $0b01,$fffe,Color00,$0444,Color01,$0444,Color02,$0444,Color03,$0444
  1405.     Dc.w    $0c01,$fffe,Color00,$0333,Color01,$0333,Color02,$0333,Color03,$0333
  1406.     Dc.w    $0d01,$fffe,Color00,$0222,Color01,$0222,Color02,$0222,Color03,$0222
  1407.     Dc.w    $0e01,$fffe,Color00,$0111,Color01,$0111,Color02,$0111,Color03,$0111
  1408.     Dc.w    $0f01,$fffe,Color00,$0000,Color01,$0000,Color02,$0000,Color03,$0000
  1409.  
  1410.  
  1411.     Dc.w    $ffff,$fffe            ;END OF COPPERLIST
  1412.  
  1413.  
  1414. Mask_1        IncBin    ram:Blaine/BitMaps/Invader.IntMask
  1415. Mask_2        IncBin    ram:Blaine/BitMaps/Invader.IntMask-2
  1416. Mask_3        IncBin    ram:Blaine/BitMaps/Invader.IntMask-3
  1417. Mask_4        IncBin    ram:Blaine/BitMaps/Invader.IntMask-4
  1418. Mask_5        IncBin    ram:Blaine/BitMaps/Invader.IntMask-5
  1419. Mask_6        IncBin    ram:Blaine/BitMaps/Invader.IntMask-6
  1420. BobGraphics_1    IncBin    ram:Blaine/BitMaps/Invader.IntRaw
  1421. BobGraphics_2    IncBin    ram:Blaine/BitMaps/Invader.IntRaw-2
  1422. BobGraphics_3    IncBin    ram:Blaine/BitMaps/Invader.IntRaw-3
  1423. BobGraphics_4    IncBin    ram:Blaine/BitMaps/Invader.IntRaw-4
  1424. BobGraphics_5    IncBin    ram:Blaine/BitMaps/Invader.IntRaw-5
  1425. BobGraphics_6    IncBin    ram:Blaine/BitMaps/Invader.IntRaw-6
  1426. Destroyed    Dcb.b    BobSize*BobDepth,$00
  1427. ShipMask    IncBin    ram:Blaine/BitMaps/Ship.IntMask
  1428. Ship        IncBin    ram:Blaine/BitMaps/Ship.IntRaw
  1429. MissileMask    IncBin    ram:Blaine/BitMaps/Missile.IntMask
  1430. Missile        IncBin    ram:Blaine/BitMaps/Missile.IntRaw
  1431. ExplosionMask1    IncBin    ram:Blaine/BitMaps/Explosion.IntMask
  1432. Explosion1    IncBin    ram:Blaine/BitMaps/Explosion.IntRaw
  1433. ExplosionMask2    IncBin    ram:Blaine/BitMaps/Explosion.IntMask-2
  1434. Explosion2    IncBin    ram:Blaine/BitMaps/Explosion.IntRaw-2
  1435. FireMask    IncBin    ram:Blaine/BitMaps/AlienFire.IntMask-3
  1436. AlienFire    IncBin    ram:Blaine/BitMaps/AlienFire.IntRaw-3
  1437. ShipExp1    IncBin    ram:Blaine/BitMaps/ShipExp.IntRaw
  1438. ShipExp2    IncBin    ram:Blaine/BitMaps/ShipExp.IntRaw-2
  1439. BonusMask    IncBin    ram:Blaine/BitMaps/Bonus.IntMask
  1440. BonusAlien    IncBin    ram:Blaine/BitMaps/Bonus.IntRaw
  1441.  
  1442.  
  1443.     Even
  1444. PlayerScoreText1    Dc.b    'Player 1:'
  1445. PlayerLivesText1    Dc.b    'Lives:'
  1446.     Even
  1447. GameOverText        Dc.b    'GAME OVER'
  1448.     Even
  1449. Font        Include    ram:Blaine/BitMaps/FontGfx        
  1450.     Even
  1451. Number_Font
  1452.          Dc.b      $7C,$C6,$CE,$DE,$F6,$E6,$7C,$00    ;0
  1453.          Dc.b      $38,$78,$18,$18,$18,$18,$7E,$00    ;1
  1454.          Dc.b      $7C,$C6,$06,$7C,$C0,$C0,$FE,$00    ;2
  1455.          Dc.b      $FC,$06,$06,$7C,$06,$06,$FC,$00    ;3
  1456.          Dc.b      $1C,$3C,$6C,$CC,$FE,$0C,$0C,$00    ;4
  1457.          Dc.b      $FE,$C0,$C0,$FC,$06,$06,$FC,$00    ;5
  1458.          Dc.b      $7E,$C0,$C0,$FC,$C6,$C6,$7C,$00    ;6
  1459.          Dc.b      $FE,$06,$06,$0C,$0C,$18,$18,$00    ;7
  1460.          Dc.b      $7C,$C6,$C6,$7C,$C6,$C6,$7C,$00    ;8
  1461.          Dc.b      $7C,$C6,$C6,$7E,$06,$06,$06,$00    ;9
  1462.     Even
  1463. ExpSample    IncBin    ram:Blaine/BitMaps/Explosion.Sample
  1464. AlienSample    IncBin    ram:Blaine/BitMaps/AlienExp.Sample
  1465. FireSample    IncBin    ram:Blaine/BitMaps/ShipFire.Sample-2
  1466.  
  1467.     
  1468. Text             ;12345678901234567899012345678901234567890
  1469.     Dc.b    "............ Invaders Mk II ............",$ee
  1470.     Dc.b    "   +++++++++++++++++++++++++++++++++++  ",$ee
  1471.     Dc.b    "                                        ",$ee
  1472.     Dc.b    "Yes Its Me Again With A New Version Of  ",$ee
  1473.     Dc.b    "The Classic Space Invaders Game.        ",$ee
  1474.     Dc.b    "As You Can See I've Taken The Gfx From  ",$ee
  1475.     Dc.b    "The Original............................",$ee
  1476.     Dc.b    "My Thanks To Dave Edwards For The Random",$ee
  1477.     Dc.b    "Number Generator Routine.               ",$ee
  1478.     Dc.b    "Enjoy................ Blaine Evans @1992",$ee
  1479.     Dc.b    "                                        ",$ee
  1480.     Dc.b    "       PRESS FIRE BUTTON TO PLAY        ",$ee
  1481.     Dc.b    $ff
  1482.     even
  1483.  
  1484.